package cn.gok.springboot.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈少华
 * @create 2022-07-14 9:33
 **/

//复合注解，相当于@ResponseBody 响应体（后端返回给前端） @Controller 标识本类是控制器
@RestController
public class HelloController {

    @Value("${my.name}")
    private String name;
    @Value("${my.password}")
    private String password;
//  前端请求的url地址
    @RequestMapping("/hello")
    public  String showHello(){
        System.out.println(name+password);
        return "hello world";
    }

}
